/*
 * Exploder
 * 
 * Tero Pyylampi (218437), Jussi Tuurinkoski (211594)
 *
 * Scene for menu
 */

#include "MenuScene.h"
#include "MenuLayer.h"
#include "../MainEngine.h"

using namespace cocos2d;


// default constructor
MenuScene::MenuScene( MainEngine *mainEngine ) : mMaster( mainEngine ), mMenuLayer( 0 ) {
	initScene();
}

// default destructor
MenuScene::~MenuScene() {
	removeChild( mMenuLayer, true );
}

// initialize this scene
void MenuScene::initScene() {
	// create logo-layer
	mMenuLayer = new MenuLayer( this );
	addChild( mMenuLayer );
	// when the layer-object is no longer needed, it can be destroyed
	mMenuLayer->release();

	// this scene needs to be updated
	scheduleUpdate();
}

// keeps updating this scene
void MenuScene::update( ccTime dt ) {
	// update layer
	mMenuLayer->update( dt );
}

// get master
MainEngine *MenuScene::getMaster() {
	return mMaster;
}
